<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: ll
  Date: 2022/9/20
  Time: 10:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>当前页</title>
</head>
<body>
    <%
    //定义图书内容。
        ArrayList<String> books = new ArrayList<String>();
        books.add("三国");
        books.add("西游");
        books.add("红楼");
        books.add("水浒");
        //将数据放入pageCount的作用域
        pageContext.setAttribute("b1",books);
        //拿到数据
        List<String> b1 = (List<String>) pageContext.getAttribute("b1");
        for (String book : b1) {
            out.println(book + "<br>");
        }
    %>
</body>
</html>
